-- Btext, a text creator using blocks for Minetest   
--	Copyright (C) 2018 Neoniet neoniet AT neoniet.com
--
--	This program is free software: you can redistribute it and/or modify
--	it under the terms of the GNU General Public License as published by
--	the Free Software Foundation, either version 3 of the License, or
--	(at your option) any later version.
--	
--	This program is distributed in the hope that it will be useful,
--	but WITHOUT ANY WARRANTY; without even the implied warranty of
--	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--	GNU General Public License for more details.
--	
--	You should have received a copy of the GNU General Public License
--	along with this program.  If not, see <https://www.gnu.org/licenses/>.
--

-- Intllib, fragment copied from mobs_npc
btext = {}
local S
if minetest.get_modpath("intllib") then
	S = intllib.Getter()
else
	S = function(s, a, ...)
		if a == nil then
			return s
		end
		a = {a, ...}
		return s:gsub("(@?)@(%(?)(%d+)(%)?)",
			function(e, o, n, c)
				if e == ""then
					return a[tonumber(n)] .. (o == "" and c or "")
				else
					return "@" .. o .. n .. c
				end
			end)
	end
end
--

btext.intllib = S
btext.modpath = minetest.get_modpath("btext")
btext.worldpath = minetest.get_worldpath()


minetest.log(S("Loading btext..."))
dofile(btext.modpath .. "/util.lua")
dofile(btext.modpath .. "/api.lua")
dofile(btext.modpath .. "/fonts.lua")
dofile(btext.modpath .. "/commands.lua")

minetest.log("Todo cargado")
